<template>
  <el-form-item label="ID">
    <el-input v-model="selectedOptions.name" disabled />
  </el-form-item>
  <el-form-item label="name">
    <el-input v-model="selectedWidget.name" disabled />
  </el-form-item>

  <el-form-item label="绑定值">
    <el-input v-model="selectedOptions.modelValue" />
  </el-form-item>
  <el-form-item label="日期选择器字段标签">
    <el-input v-model="selectedOptions.datepickerText" />
  </el-form-item>
  <el-form-item label="是否只读">
    <el-switch v-model="selectedOptions.readonly" />
  </el-form-item>
  <el-form-item label="是否禁用">
    <el-switch v-model="selectedOptions.disabled" />
  </el-form-item>
  <el-form-item label="输入框尺寸">
    <el-select v-model="selectedOptions.size" placeholder="Select">
      <el-option
        v-for="item in sizeOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="文本框可输入">
    <el-switch v-model="selectedOptions.editable" />
  </el-form-item>
  <el-form-item label="是否显示清除按钮">
    <el-switch v-model="selectedOptions.clearable" />
  </el-form-item>
  <el-form-item label="非范围选择时的占位内容">
    <el-input v-model="selectedOptions.placeholder" />
  </el-form-item>
  <el-form-item label="范围选择时开始日期的占位内容">
    <el-input v-model="selectedOptions.startPlaceholder" />
  </el-form-item>
  <el-form-item label="范围选择时结束日期的占位内容">
    <el-input v-model="selectedOptions.endPlaceholder" />
  </el-form-item>
  <el-form-item label="显示类型">
    <el-select v-model="selectedOptions.type" placeholder="Select">
      <el-option
        v-for="item in typeOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="显示在输入框中的格式">
    <el-select v-model="selectedOptions.format" placeholder="Select">
      <el-option
        v-for="item in formatOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="可选，绑定值的格式">
    <el-select v-model="selectedOptions.valueFormat" placeholder="Select">
      <el-option
        v-for="item in valueFormatOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="选择范围时的分隔符">
    <el-input v-model="selectedOptions.rangeSeparator" />
  </el-form-item>
  <el-form-item label="是否触发表单验证">
    <el-switch v-model="selectedOptions.validateEvent" />
  </el-form-item>
</template>

<script setup>
defineOptions({
  name: "datepickerAttribute",
  inheritAttrs: false,
});
let $props = defineProps({
  selectedWidget: {
    type: Object,
    required: true,
  },
  selectedOptions: {
    type: Object,
    required: true,
  },
});
let sizeOptions = [
  {
    value: "large",
    label: "large",
  },
  {
    value: "default",
    label: "default",
  },
  {
    value: "small",
    label: "small",
  },
];
let typeOptions = [
  {
    value: "year",
    label: "year",
  },
  {
    value: "years",
    label: "years",
  },
  {
    value: "month",
    label: "month",
  },
  {
    value: "date",
    label: "date",
  },
  {
    value: "dates",
    label: "dates",
  },
  {
    value: "datetime",
    label: "datetime",
  },
  {
    value: "week",
    label: "week",
  },
  {
    value: "datetimerange",
    label: "datetimerange",
  },
  {
    value: "daterange",
    label: "daterange",
  },
  {
    value: "monthrange",
    label: "monthrange",
  },
];
let formatOptions = [
  {
    value: "YYYY-MM-DD",
    label: "YYYY-MM-DD",
  },
  {
    value: "YYYY/MM/DD",
    label: "YYYY/MM/DD",
  },
  {
    value: "YYYY年MM月DD日",
    label: "YYYY年MM月DD日",
  },
  {
    value: "YYYY-MM-DD HH:mm:ss",
    label: "YYYY-MM-DD HH:mm:ss",
  },
  {
    value: "YYYY-MM-DD hh:mm:ss",
    label: "YYYY-MM-DD hh:mm:ss",
  },
  {
    value: "",
    label: "default",
  },
];
let valueFormatOptions = [
  {
    value: "YYYY-MM-DD",
    label: "YYYY-MM-DD",
  },
  {
    value: "YYYY-MM-DD HH:mm:ss",
    label: "YYYY-MM-DD HH:mm:ss",
  },
  {
    value: "",
    label: "default",
  },
];
</script>

<style lang="scss" scoped></style>
